package com.lw.structural.bridge;

import com.lw.structural.bridge.abs.DrawAPI;
import com.lw.structural.bridge.abs.Shape;

public class Circle extends Shape {
   private int x, y, radius;

   //DrawAPI桥接抽象，具体参数new 一个桥接实现
   //方便横向扩展更多的颜色（桥接实现）
   public Circle(int x, int y, int radius, DrawAPI drawAPI) {
      super(drawAPI);
      this.x = x;  
      this.y = y;  
      this.radius = radius;
   }
 
   public void draw() {//继承Shape的方法
      //继承的drawAPI属性，调用其中的方法传递参数给到实现类
      drawAPI.drawCircle(radius,x,y);
   }
}